package pri.hillchen.springbootstd.sso.common.response;

/**
 * @author:hillchen
 * @DESCRIPTION:
 * @Date: Created in 9:17 2017/12/26 0026.
 */
public class SimpleResponse implements ResponseResult {
    private boolean succ = true;
    private String reqCode = ResponseConstant.REQ_CODE_SUCC;
    private String reqMsg = ResponseConstant.REQ_MSG_SUCC;

    @Override
    public boolean isSucc() {
        return succ;
    }

    public void setSucc(boolean succ) {
        this.succ = succ;
    }

    @Override
    public String getReqCode() {
        return reqCode;
    }

    public void setReqCode(String reqCode) {
        this.reqCode = reqCode;
    }

    @Override
    public String getReqMsg() {
        return reqMsg;
    }

    public void setReqMsg(String reqMsg) {
        this.reqMsg = reqMsg;
    }

    @Override
    public void failReq(String reqMsg) {
        failReq(reqMsg,ResponseConstant.REQ_CODE_FAIL);
    }

    @Override
    public void failReq(String reqMsg, String reqCode) {
        setSucc(false);
        setReqCode(reqCode);
        setReqMsg(reqMsg);
    }

    @Override
    public void succReq(String reqMsg) {

        setReqCode(ResponseConstant.REQ_CODE_SUCC);
        setReqMsg(reqMsg);
    }
}
